<template>
  <el-select filterable remote :remote-method="getOptions" value-key="court_id" remote-show-suffix>
    <el-option v-for="item in options" :key="item.court_id" :value="isObject ? item : item.court_id"
      :label="item.name"></el-option>
  </el-select>
</template>

<script setup>
import { getCourtList } from '@/api/court'
import { ref } from 'vue';
const props = defineProps({
  isObject: Boolean
});
const options = ref([]);
const getOptions = async (kw) => {
  const { data } = await getCourtList({
    keyword: (kw || '').trim(),
  });
  options.value = data || [];
};
getOptions();
</script>